import { get, post, upload, uploadAddressBook } from "../fetch/api";

//登陆
export const login = params => post("login", params);

//查询用户列表
export const users = params => get("listBackendUser", params);

//新增用户
export const addUser = params => post("addFrontUser", params);

//删除用户
export const delUser = params => post("deleteUser", params);

//修改用户
// export const putUser = params => put('/sys/user/update', params)
export const putUser = params => post("/sys/user/update", params);

//新增角色
export const addRole = params => post("addRole", params);

//删除角色
// export const delRole = params => del('/sys/role/delete', params)
export const delRole = params => post("deleteRole", params);

//修改角色
export const updateRole = params => post("updateRole", params);

//所有角色分页
// export const allRoles = params => get('/sys/role/findAll', params)
export const getAllRoles = params => get("listRole", params);

export const user = {
  frontUser: params => get("listFrontUser", params), //前台用户列表
  updateUser: params => post("updateBackendUser", params),
  //删除用户
  deleteUser: params => post("deleteUser", params),

  //权限
  privilegeList: params => get("listPrivilege", params), //权限列表
  addPrivilege: params => post("addPrivilege", params), //新增权限
  deletePrivilege: params => post("deletePrivilege", params), //删除权限
  updatePrivilege: params => post("updatePrivilege", params), //更新权限

  addPrivilegeToRole: params => post("addPrivilegeToRole", params) //更新角色添加权限
};

//专家
export const expert = {
  //查询所有专家
  allExpert: params => get("listProfessor", params),
  addProfessor: params => post("addProfessor", params),
  deleteApi: params => post("deleteProfessor", params),
  updateApi: params => post("updateProfessor", params),
  orgs: () => get("listOrganizationAll"),
  domains: () => get("listResearchFieldAll"),
  disableTypeApi: params => post("disableOrEnableProfessor", params),

  //领域列表
  allDomain: params => get("listResearchField", params),
  updateDomain: params => post("updateResearchField", params),
  deleteDomain: params => post("deleteResearchField", params),
  addDomain: params => post("addResearchField", params)
};

//通知公告
export const notification = {
  list: params => get("listAdvice", params),
  add: params => post("addAdvice", params),
  deleteApi: params => post("deleteAdvice", params),
  update: params => post("updateAdvice", params),
  disableApi: params => post("disableOrEnableAdvice", params),
  adverUser: params => get("listAdviceEnrollUser", params)
};
//广告管理
export const ad = {
  listApi: params => get("listAdver", params),
  addApi: params => post("addAdver", params),
  deleteApi: params => post("deleteAdver", params),
  updateApi: params => post("updateAdver", params),
  disableApi: params => post("disableOrEnableAdver", params)
};

//课程管理
export const course = {
  courseList: params => get("listCourse", params),
  addCourse: params => post("addCourse", params),
  deleteCourse: params => post("deleteCourse", params),
  updateCourse: params => post("updateCourse", params),
  typeList: params => get("listCourseType", params),
  addType: params => post("addCourseType", params),
  deleteType: params => post("deleteCourseType", params),
  updateType: params => post("updateCourseType", params)
};
//文件下载管理
export const download = {
  listApi: params => get("listFile", params),
  addApi: params => post("addFile", params),
  deleteApi: params => post("deleteFile", params),
  updateApi: params => post("updateFile", params)
};

//合作单位
export const paterner = {
  listApi: params => get("listPaterner", params),
  addApi: params => post("addPaterner", params),
  updateApi: params => post("updatePaterner", params),
  deleteApi: params => post("deletePaterner", params),
  disableApi: params => post("disableOrEnablePaterner", params),
  allTypes: () => get("listPaternerTypeAll"),

  listTypeApi: params => get("listPaternerType", params),
  addTypeApi: params => post("addPaternerType", params),
  updateTypeApi: params => post("updatePaternerType", params),
  deleteTypeApi: params => post("deletePaternerType", params),
  disableTypeApi: params => post("disableOrEnablePaternerType", params)
};

//音视频
export const video = {
  listApi: params => get("listMedia", params),
  addApi: params => post("addMedia", params),
  deleteApi: params => post("deleteMedia", params),
  updateApi: params => post("updateMedia", params),
  disableApi: params => post("disableOrEnableMedia", params)
};

//要闻动态
export const news = {
  listApi: params => get("listFocusNews", params),
  addApi: params => post("addFocusNews", params),
  updateApi: params => post("updateFocusNews", params),
  deleteApi: params => post("deleteFocusNews", params),
  disableApi: params => post("disableOrEnableFocusNews", params),
  allTypes: () => get("listFocusNewsTypeAll"),

  listTypeApi: params => get("listFocusNewsType", params),
  addTypeApi: params => post("addFocusNewsType", params),
  updateTypeApi: params => post("updateFocusNewsType", params),
  deleteTypeApi: params => post("deleteFocusNewsType", params),
  disableTypeApi: params => post("disableOrEnableFocusNewsType", params)
};

//会议论坛
export const forum = {
  listApi: params => get("listForum", params),
  addApi: params => post("addForum", params),
  updateApi: params => post("updateForum", params),
  deleteApi: params => post("deleteForum", params),
  disableApi: params => post("disableOrEnableForum", params),
  allTypes: () => get("listForumTypeAll"),

  listTypeApi: params => get("listForumType", params),
  addTypeApi: params => post("addForumType", params),
  updateTypeApi: params => post("updateForumType", params),
  deleteTypeApi: params => post("deleteForumType", params),
  disableTypeApi: params => post("disableOrEnableForumType", params)
};

//热点资讯
export const hotNews = {
  listApi: params => get("listHotNews", params),
  addApi: params => post("addHotNews", params),
  updateApi: params => post("updateHotNews", params),
  deleteApi: params => post("deleteHotNews", params),
  disableApi: params => post("disableOrEnableHotNews", params),
  allTypes: () => get("listHotNewsTypeAll"),

  listTypeApi: params => get("listHotNewsType", params),
  addTypeApi: params => post("addHotNewsType", params),
  updateTypeApi: params => post("updateHotNewsType", params),
  deleteTypeApi: params => post("deleteHotNewsType", params),
  disableTypeApi: params => post("disableOrEnableHotNewsType", params)
};

//决策管理
export const decision = {
  listApi: params => get("listDecision", params),
  addApi: params => post("addDecision", params),
  updateApi: params => post("updateDecision", params),
  deleteApi: params => post("deleteDecision", params),
  disableApi: params => post("disableOrEnableDecision", params),
  allTypes: () => get("listDecisionTypeAll"),

  listTypeApi: params => get("listDecisionType", params),
  addTypeApi: params => post("addDecisionType", params),
  updateTypeApi: params => post("updateDecisionType", params),
  deleteTypeApi: params => post("deleteDecisionType", params),
  disableTypeApi: params => post("disableOrEnableDecisionType", params),
  commentListApi: params => get("listDecisionCommentForBackend", params),
  commentDisableApi: params => post("disableOrEnableDecisionComment", params),
  questionListApi: params => get("listDecisionQuestion", params)
};

export const point = {
  listApi: params => get("listViewpoint", params),
  addApi: params => post("addViewpoint", params),
  updateApi: params => post("updateViewpoint", params),
  deleteApi: params => post("deleteViewpoint", params),
  disableApi: params => post("disableOrEnableViewpoint", params),
  allTypes: () => get("listViewpointTypeAll"),

  listTypeApi: params => get("listViewpointType", params),
  addTypeApi: params => post("addViewpointType", params),
  updateTypeApi: params => post("updateViewpointType", params),
  deleteTypeApi: params => post("deleteViewpointType", params),
  disableTypeApi: params => post("disableOrEnableViewpointType", params)
};

export const thinkTank = {
  listApi: params => get("listThinkTank", params),
  addApi: params => post("addThinkTank", params),
  updateApi: params => post("updateThinkTank", params),
  deleteApi: params => post("deleteThinkTank", params),
  disableApi: params => post("disableOrEnableThinkTank", params),
  allTypes: () => get("listThinkTankTypeAll"),

  listTypeApi: params => get("listThinkTankType", params),
  addTypeApi: params => post("addThinkTankType", params),
  updateTypeApi: params => post("updateThinkTankType", params),
  deleteTypeApi: params => post("deleteThinkTankType", params),
  disableTypeApi: params => post("disableOrEnableThinkTankType", params)
};

export const org = {
  addApi: params => post("addOrganization", params),
  orgListApi: params => get("listOrganization", params),
  deleteApi: params => post("deleteOrganization", params),
  allOrg: params => get("listOrganizationAll", params),
  updateApi: params => post("updateOrganization", params),
  disableApi: params => post("disableOrEnableOrganization", params)
};

export const alliance = {
  addApi: params => post("addAlliance", params),
  listApi: params => get("listAlliance", params),
  deleteApi: params => post("deleteAlliance", params),
  updateApi: params => post("updateAlliance", params)
};

export const allianceActivity = {
  addApi: params => post("addAllianceActivity", params),
  activityListApi: params => get("listAllianceActivity", params),
  deleteApi: params => post("deleteAllianceActivity", params),
  updateApi: params => post("updateAllianceActivity", params),
  disableApi: params => post("disableOrEnableAllianceActivity", params)
};

//智库单位机构
export const orgJg = {
  addApi: params => post("addOrgJg", params),
  listApi: params => get("listOrgJg", params),
  updateApi: params => post("updateOrgJg", params),
  deleteApi: params => post("deleteOrgJg", params),
  disableApi: params => post("disableOrEnableOrgJg", params)
};
//智库领导
export const orgLeader = {
  addApi: params => post("addOrgLeader", params),
  listApi: params => get("listOrgLeader", params),
  updateApi: params => post("updateOrgLeader", params),
  deleteApi: params => post("deleteOrgLeader", params),
  disableApi: params => post("disableOrEnableOrgLeader", params)
};

//机构动态
export const orgDynamic = {
  addApi: params => post("addOrgDynamic", params),
  listApi: params => get("listOrgDynamic", params),
  updateApi: params => post("updateOrgDynamic", params),
  deleteApi: params => post("deleteOrgDynamic", params),
  disableApi: params => post("disableOrEnableOrgDynamic", params)
};

//机构研究项目
export const orgProject = {
  addApi: params => post("addOrgProject", params),
  listApi: params => get("listOrgProject", params),
  updateApi: params => post("updateOrgProject", params),
  deleteApi: params => post("deleteOrgProject", params),
  disableApi: params => post("disableOrEnableOrgProject", params),
  addTypeApi: params => post("addOrgProjectType", params),
  listTypeAllApi: params => get("listOrgProjectTypeAll", params),
  listTypeApi: params => get("listOrgProjectType", params),
  updateTypeApi: params => post("updateOrgProjectType", params),
  deleteTypeApi: params => post("deleteOrgProjectType", params),
  disableTypeApi: params => post("disableOrEnableOrgProjectType", params)
};

//机构出版物
export const orgPublish = {
  addApi: params => post("addOrgPublish", params),
  listApi: params => get("listOrgPublish", params),
  updateApi: params => post("updateOrgPublish", params),
  deleteApi: params => post("deleteOrgPublish", params),
  disableApi: params => post("disableOrEnableOrgPublish", params),
  addTypeApi: params => post("addOrgPublishType", params),
  listTypeAllApi: params => get("listOrgPublishTypeAll", params),
  listTypeApi: params => get("listOrgPublishType", params),
  updateTypeApi: params => post("updateOrgPublishType", params),
  deleteTypeApi: params => post("deleteOrgPublishType", params),
  disableTypeApi: params => post("disableOrEnableOrgPublishType", params)
};

//机构研究成功
export const orgResult = {
  addApi: params => post("addOrgResult", params),
  listApi: params => get("listOrgResult", params),
  updateApi: params => post("updateOrgResult", params),
  deleteApi: params => post("deleteOrgResult", params),
  disableApi: params => post("disableOrEnableOrgResult", params),
  addTypeApi: params => post("addOrgResultType", params),
  listTypeAllApi: params => get("listOrgResultTypeAll", params),
  listTypeApi: params => get("listOrgResultType", params),
  updateTypeApi: params => post("updateOrgResultType", params),
  deleteTypeApi: params => post("deleteOrgResultType", params),
  disableTypeApi: params => post("disableOrEnableOrgResultType", params)
};

//决策专刊
export const special = {
  addApi: params => post("addSpecial", params),
  listApi: params => get("listSpecial", params),
  updateApi: params => post("updateSpecial", params),
  deleteApi: params => post("deleteSpecial", params),
  disableApi: params => post("disableOrEnableSpecial", params),
  addTypeApi: params => post("addSpecialType", params),
  listTypeAllApi: params => get("listSpecialTypeAll", params),
  listTypeApi: params => get("listSpecialType", params),
  updateTypeApi: params => post("updateSpecialType", params),
  deleteTypeApi: params => post("deleteSpecialType", params),
  disableTypeApi: params => post("disableOrEnableSpecialType", params),

  addSpecialTypeFather: params => post("addSpecialTypeFather", params),
  listSpecialTypeFather: params => get("listSpecialTypeFather", params),
  listSpecialTypeFatherAll: params => get("listSpecialTypeFatherAll", params),
  deleteSpecialTypeFather: params => post("deleteSpecialTypeFather", params),
  updateSpecialTypeFather: params => post("updateSpecialTypeFather", params),
  disableSpecialTypeFather: params =>
    post("disableOrEnableSpecialTypeFather", params)
};

export const TTResult = {
  addApi: params => post("addTtResult", params),
  listApi: params => get("listTtResult", params),
  updateApi: params => post("updateTtResult", params),
  deleteApi: params => post("deleteTtResult", params),
  disableApi: params => post("disableOrEnableTtResult", params),
  addTypeApi: params => post("addTtResultType", params),
  listTypeAllApi: params => get("listTtResultTypeAll", params),
  listTypeApi: params => get("listTtResultType", params),
  updateTypeApi: params => post("updateTtResultType", params),
  deleteTypeApi: params => post("deleteTtResultType", params),
  disableTypeApi: params => post("disableOrEnableTtResultType", params)
};

//社会调查服务
export const questionnaire = {
  //新增问卷题目类型
  listTypeApi: params => get("listQuestionnaireSubType", params),
  listTypeAllApi: params => get("listQuestionnaireSubTypeAll", params),
  addTypeApi: params => post("addQuestionnaireSubType", params),
  deleteTypeApi: params => post("deleteQuestionnaireSubType", params),
  updateTypeApi: params => post("updateQuestionnaireSubType", params),
  disableTypeApi: params => post("disableOrEnableQuestionnaireSubType", params),

  //问卷
  listApi: params => get("listQuestionnaire", params),
  addApi: params => post("addQuestionnaire", params),
  deleteApi: params => post("deleteQuestionnaire", params),
  updateApi: params => post("updateQuestionnaire", params),
  disableApi: params => post("disableOrEnableQuestionnaire", params),

  //问卷新增题目
  addSubjectForQuestionApi: params =>
    post("addSubjectForQuestionnaire", params),

  //问卷所有题目列表
  listQuestionSubjectAllApi: params =>
    get("listQuestionnaireSubjectAll", params),

  //问卷选项
  addOptionApi: params => post("addQuestionnaireOption", params),
  deleteOptionApi: params => post("deleteQuestionnaireOption", params),
  updateOptionApi: params => post("updateQuestionnaireOption", params),

  //问卷题目
  deleteSubjectApi: params => post("deleteQuestionnaireSubject", params)
};

//通讯录
export const addressBook = {
  //导入
  importApi: (params, success) => uploadAddressBook(params, success),
  //通讯录列表
  listApi: params => get("listAddressList", params),
  //通讯录单位
  listCompanyApi: params => get("listAddressListCompany", params),
  //通讯录单位部分
  listDepartmenApi: params => get("listAddressListDepartment", params),
  //删除通讯录
  deleteApi: params => post("deleteAddressList", params),
  //删除通讯录单位
  deleteCompanyApi: params => post("deleteAddressListCompany", params),
  //删除单位部门
  deleteDepartment: params => post("deleteAddressListDepartment", params),
  //发送
  sendApi: params => post("sendMsg", params)
};

export const evaluation = {
  listApi: params => get("listEvaluation", params),
  addApi: params => post("addEvaluation", params),
  updateApi: params => post("updateEvaluation", params),
  deleteApi: params => post("deleteEvaluation", params),
  disableApi: params => post("disableOrEnableEvaluation", params),
  allTypes: () => get("listEvaluationTypeAll"),

  listTypeApi: params => get("listEvaluationType", params),
  addTypeApi: params => post("addEvaluationType", params),
  updateTypeApi: params => post("updateEvaluationType", params),
  deleteTypeApi: params => post("deleteEvaluationType", params),
  disableTypeApi: params => post("disableOrEnableEvaluationType", params)
};

export const userCenter = {
  publishAdmin: params => get("listUserPublishForAdmin", params),
  checkPublish: params => get("checkUserPublish", params)
};

//学习资料
export const learn = {
  listApi: params => get("listLearningMaterials", params),
  addApi: params => post("addLearningMaterials", params),
  updateApi: params => post("updateLearningMaterials", params),
  deleteApi: params => post("deleteLearningMaterials", params),
  disableApi: params => post("disableOrEnableLearningMaterials", params)
};
//文件上传
export const uploadFile = (params, success) => upload(params, success);
export const downlaodFile = (params, success) => download(params, success);

//新增机构
export const addOrganization = params => post("/organization/add", params);

//删除机构
// export const delOrganization = params => del('/organization/delete', params)
export const delOrganization = params => del("/organization/delete", params);

//修改机构
// export const putOrganization = params => put('/organization/update', params)
export const putOrganization = params => post("/organization/update", params);

//查询所有机构(分页)
export const allOrganizations = params => get("listOrganization", params);
//查询所有机构
export const allOrg = () => get("/organization/getAll");

//删除专家
// export const delExpert = params => del('/expert/delete', params)
export const delExpert = params => del("/expert/delete", params);

//修改专家
// export const putExpert = params => put('/expert/update', params)
export const putExpert = params => post("/expert/update", params);

//新增文章分类
export const addArticleType = params => post("/articleSort/add", params);

//删除文章分类
// export const delArticleType = params => del('/articleSort/delete', params)
export const delArticleType = params => del("/articleSort/delete", params);

//修改文章分类
// export const putArticleType = params => put('/articleSort/update', params)
export const putArticleType = params => post("/articleSort/update", params);
//查询所有的二级文章分类
export const secondType = () => get("/articleSort/getJuniorAll");

export const firstType = params => get("/articleSort/getArticleSort", params);

//查询所有文章分类
export const allArt = () => get("/articleSort/getAll");
//分布查询文章分类
export const getAllArticelType = params => get("/articleSort/findAll", params);

//新增文章
export const addArticle = params => post("/article/add", params);

//删除文章
// export const delArticle = params => del('/article/delete', params)
export const delArticle = params => del("/article/delete", params);

//修改文章
// export const putArticle = params => put('/article/update', params)
export const putArticle = params => post("/article/update", params);

//文章列表
export const allArticle = params => get("/article/findAll", params);

//地域列表
export const territory = () => get("/territory/findAll");

//新增视频
export const addVideo = params => post("/videoNews/add", params);

//删除视频
// export const delVideo = params => del('/videoNews/delete', params)
export const delVideo = params => del("/videoNews/delete", params);

//修改视频
// export const putVideo = params => put('/videoNews/update', params)
export const putVideo = params => post("/videoNews/update", params);

//视频列表
export const allVideo = params => get("/videoNews/findAll", params);

//用户操作记录
export const log = params => get("/operationNote/findAll", params);

//专题广告

export const getAdTypes = params => get("/getAdTypes", params);

export const editAdType = params => post("/editType", params);
export const delAdType = params => post("/delType", params);
export const editState = params => post("/editState", params);

export const editThemeAd = params => post("/editThemeAd", params);

export const getThemeAds = params => get("/getThemeAds", params);

export const delThemeAd = params => post("/delThemeAd", params);
export const editThemeAdState = params => post("/editThemeAdState", params);

export const getParentAdTypes = parmas => get("/getParentAdTypes", parmas);

export const editParentAdType = params => post("/editParentAdType", params);

export const delParentAdType = params => post("/delParentAdType", params);

export const getChildTypeById = parmas => get("/getChildTypeById", parmas);
